import java.util.Arrays;
import java.util.Scanner;

public class Practice1105 {
    //通配符
    public static void main38(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNextLine()){
            String t=scanner.nextLine();
            String s=scanner.nextLine();
            System.out.println(isMatching(t,s));
        }

    }
    private static boolean isMatching(String t,String s){
        char[] ct=t.toCharArray();
        char[] cs=s.toCharArray();
        boolean[][] dp=new boolean[cs.length+1][ct.length+1];
        dp[0][0]=true;
        for(int i=0;i<=cs.length;i++){
            for(int j=1;j<=ct.length;j++){
                if(ct[j-1]=='*'){
                    if(i==0){
                        dp[i][j]=dp[i][j-1];
                    }else {
                        if(cs[i-1]=='.'||
                                cs[i-1]>='a'&&cs[i-1]<='z'||
                                cs[i-1]>='A'&&cs[i-1]<='Z'||
                                cs[i-1]>='0'&&cs[i-1]<='9'
                        ){//这里i-1是字符串数组的下标比如abc,a的下标是0,i=1要取a就要i-1
                            dp[i][j]=dp[i-1][j]||dp[i][j-1];//*前面的数是否匹配或者*能否匹配后面的数
                        }
                    }
                }else{
                    if(i>0&&defc(cs[i-1],ct[j-1])){//该字符是否匹配
                        dp[i][j]=dp[i-1][j-1];//该字符的前面一个字符是否匹配
                    }
                }
            }
        }
        return dp[cs.length][ct.length];
    }
    private static boolean defc(char s,char t){
        if(t=='?') return true;
        if(s>='A'&&s<='Z'){
            s+=32;
        }
        if(t>='A'&&t<='Z'){
            t+=32;
        }
        return s==t;
    }
    //求兔子数量,第3天的数量等于前两天的和
    public static void main39(String[] args){
        Scanner scan= new Scanner(System.in);
        while(scan.hasNextInt()){
            int n=scan.nextInt();
            System.out.println(num(n));
        }
    }
    private static int num(int n){
        int fir=1;
        int sec=1;
        int num=0;
        for(int i=3;i<=n;i++){
            num=fir+sec;
            fir=sec;
            sec=num;
        }
        if(n<3){
            return 1;
        }
        return num;
    }
    //小易的升级之路
    public static void main40(String[] args){
        Scanner scan = new Scanner(System.in);
        int[] array=null;
        int n=0;
        int a=0;
        while(scan.hasNext()){
            n=scan.nextInt();
            a=scan.nextInt();
            array = new int[n];
            for(int i=0;i<n;i++){
                array[i]=scan.nextInt();
            }
            for(int i=0;i<array.length;i++){
                if(array[i]<=a){
                    a=a+array[i];
                }else{
                    a+=gbc2(a,array[i]);
                }
            }
            System.out.println(a);

        }

    }

    private static int gbc2(int a,int b){//a<b
        int r=0;
        while((r=b%a)>0){
            b=a;
            a=r;
        }
        return a;
    }
    //找出字符串中第一个只出现一次的字符
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
        while(scan.hasNextLine()){
            String str=scan.nextLine();
            char[] ch=str.toCharArray();
            int[] array=new int[ch.length];
            Arrays.sort(ch);
            char tmp=ch[0];
            for (int i = 1; i <ch.length ; i++) {
                if(tmp==ch[i]){
                    array[i]=1;
                    array[i-1]=1;
                    tmp=ch[i];
                }else {
                    tmp=ch[i];
                }
            }
            int sum=0;
            int dex=Integer.MAX_VALUE;
            for (int i = 0; i <array.length ; i++) {
                sum+=array[i];
                if(array[i]==0){
                    if(dex>str.indexOf(ch[i])){
                        dex=str.indexOf(ch[i]);
                    }
                }
            }
            if(sum==array.length){
                System.out.println(-1);
            }else {
                System.out.println(str.charAt(dex));
            }

        }
    }
}
